﻿<UserControl x:Class="AutoExpandOver.Demo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mycontrols="clr-namespace:Png.Silverlight.Controls;assembly=Png.Silverlight.Controls.AutoExpandOver"
    mc:Ignorable="d" >
    <StackPanel x:Name="LayoutRoot" >
        <mycontrols:AutoExpandOver OpenOnHover="True" OpenOnClick="False" OpenOnFocus="False" Width="200" Height="75">
            <mycontrols:AutoExpandOver.Header>
                <Border BorderThickness="3" BorderBrush="Blue" CornerRadius="5">
                    <StackPanel Width="250" Height="75">
                        <TextBlock Text="Hover to Open"/>
                        <TextBlock Text="Hover off to Close unless it has focus"/>
                        <TextBlock Text="Click button on popup to give focus"/>
                        <TextBlock Text="Click off to close"/>
                    </StackPanel>
                </Border>
            </mycontrols:AutoExpandOver.Header>
            <Border Background="AntiqueWhite" BorderBrush="Black">
            <StackPanel>
                    <Button Content="Button 1"/>
                    <Button Content="Button 2"/>
                    <Button Content="Button 3"/>
                    <TextBlock Text="Some text"/>
                </StackPanel>
                </Border>
        </mycontrols:AutoExpandOver>
        <mycontrols:AutoExpandOver Margin="0,5,0,0" OpenOnHover="False" CloseOnHover="False" OpenOnClick="True" CloseOnClick="True" OpenOnFocus="False" Width="200" Height="35">
            <mycontrols:AutoExpandOver.Header>
                <Border BorderThickness="1" BorderBrush="Blue" Width="200" Height="35">
                    <StackPanel>
                        <TextBlock Text="Click to Open"/>
                        <TextBlock Text="Click off to Close"/>
                    </StackPanel>
                </Border>
            </mycontrols:AutoExpandOver.Header>
            <Border Background="AntiqueWhite" BorderBrush="Black">
                <StackPanel>
                    <Button Content="Button 1"/>
                    <Button Content="Button 2"/>
                    <Button Content="Button 3"/>
                    <TextBlock Text="Some text"/>
                </StackPanel>
            </Border>
        </mycontrols:AutoExpandOver>
        <mycontrols:AutoExpandOver OpenOnHover="False" OpenOnClick="False" OpenOnFocus="True" Width="200" Height="35">
            <mycontrols:AutoExpandOver.Header>
                <Border BorderThickness="1" BorderBrush="Blue" Width="200" Height="35">
                    <StackPanel>
                        <TextBlock Text="Open popup when you focus this box (tab to it or click it)"/>
                    </StackPanel>
                </Border>
            </mycontrols:AutoExpandOver.Header>
            <Border Background="AntiqueWhite" BorderBrush="Black">
                <StackPanel>
                    <Button Content="Button 1"/>
                    <Button Content="Button 2"/>
                    <Button Content="Button 3"/>
                    <TextBlock Text="Some text"/>
                </StackPanel>
            </Border>
        </mycontrols:AutoExpandOver>
    </StackPanel>
</UserControl>
